# -*- coding: utf-8 -*-
"""
Created on Wed Jun  8 00:54:38 2016

@author: 思源
"""

def gen():
    n = 0
    while True:
        n = yield n
        n = n * 2

c = gen()
print(next(c))

print(c.send(1))

print(c.send(2))


    